package com.fone.player.sns.view;

import com.fone.player.R;
import com.fone.player.sns.util.SNSUtil;

import cn.sharesdk.framework.TitleLayout;
import cn.sharesdk.framework.authorize.AuthorizeAdapter;

public class MyAuthorizeAdapter extends AuthorizeAdapter {

	private static boolean isShowing = false;
	
	public static boolean open = false;
	
	@Override
	public void onCreate(){
		super.onCreate();
		
		if(!open){
			getActivity().finish();
			return ;
		}
		if(isShowing){
			getActivity().finish();
			return ;
		}
		
		isShowing = true;
		SNSUtil.setSNSPageState(isShowing);
		
		hideShareSDKLogo();
		disablePopUpAnimation();
		String platName = getPlatformName();
		if("QZone".equals(platName)){
			TitleLayout llTitle = getTitleLayout();
			llTitle.getTvTitle().setText(R.string.tencent_qq);
		}
	}
	
	@Override
	public void onDestroy() {
		super.onDestroy();
		if(isShowing){
			isShowing = false;
			open = false;
			SNSUtil.setSNSPageState(isShowing);
		}
	}
	
}
